package com.lant.exception;

import com.lant.enums.ResponseStatusEnum;

/**
 * @ClassName: ErrorMsgException
 * @Description: 自定义异常
 * @date 2020年5月1日
 */
public class ErrorMsgException extends RuntimeException {

	private static final long serialVersionUID = 1696242727582922086L;

	private Integer code;

	public ErrorMsgException() {
		super();
	}

	public ErrorMsgException(String message) {
		super(message);
		this.code = ResponseStatusEnum.BAD_REQUEST.getValue();
	}

	public ErrorMsgException(String message, Integer code) {
		super(message);
		this.code = code;
	}

	public ErrorMsgException(String message, Throwable cause) {
		super(message, cause);
	}

	public ErrorMsgException(Throwable cause) {
		super(cause);
	}

	protected ErrorMsgException(String message, Throwable cause, boolean enableSuppression,
			boolean writableStackTrace) {
		super(message, cause, enableSuppression, writableStackTrace);
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

}
